package com.kust.smarthome.web.controller;


import com.kust.smarthome.web.model.Banner;
import com.kust.smarthome.web.service.IBannerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author iAuzre
 * @since 2021-06-28
 */
@RestController
@RequestMapping("/banner")
@Api(value = "轮播图相关操作", tags = {"banner-tag"})
public class BannerController {

    @Resource
    private IBannerService bannerService;

    /**
     * 获取数据库中所有的Banner信息
     * @return List<Banner>
     */
    @ApiOperation(value = "查询所有轮播图")
    @GetMapping("")
    public List<Banner> list() {
        return bannerService.list();
    }
}
